import {Result} from '@/base/Result';
import {request} from '@/base/Request';
import {Page} from '@/base/Page';
import {Order} from '@/base/model/Order';
import {OrderDetail} from '@/base/model/OrderDetail';

export function getOrderList(params: {
  pageIndex: number,
  pageSize: number,
  phone?:string,
  orderNum?:string,
  orderState?:number,
  createBegin?: string,
  createEnd?: string,
  sortDirection?:string
}): Promise<Result<Page<Order>>> {
  return request.getPage(Order, '/api/post-sale/fetchOrderList', {params});
}

export function getOrder(params: {
  orderId: number
}): Promise<Result<String>> {
  return request.get(String, `/api/post-sale/fetchOrderDetail`, {params});
}
// export function getOrderDetail(id: number): Promise<Result<Page<OrderDetail>>> {
//   return request.getPage(OrderDetail, `/api/api/${id}`);
// }
